package com.zhuss.core.db.dao.ext;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.zhuss.bean.bo.core.append.SearchUserAppendBo;
import com.zhuss.bean.vo.core.append.DetailUserAppendVo;
import com.zhuss.bean.vo.core.append.ListUserAppendVo;
import com.zhuss.core.db.dao.gen.UserAppendMapper;
import com.zhuss.core.db.entity.UserAppend;

/**
 * @description: 用户关注、点赞数据库Dao
 * @author: zhushanshuo
 * @create: Fri Jul 03 20:49:22 CST 2020
 **/

@Mapper
public interface UserAppendDao extends UserAppendMapper {
	
	void create(UserAppend record);
	
	void delete(UserAppend record);
	
	DetailUserAppendVo getByType(@Param("type") Integer type, @Param("targetUserId") Long targetUserId, @Param("creatorId") Long creatorId);
	
	List<DetailUserAppendVo> listByType(@Param("type") Integer type, @Param("targetUserId") Long targetUserId, @Param("creatorId") Long creatorId, @Param("start") Integer start, @Param("length") Integer length);
	
	Integer updateAlreadyRead(@Param("type") Integer type, @Param("targetUserId") Long targetUserId, @Param("isRead") Integer isRead);

	Integer countNoReadNum(@Param("type") Integer type, @Param("targetUserId") Long targetUserId, @Param("isRead") Integer isRead);
	
	Integer countListByType(@Param("type") Integer type, @Param("targetUserId") Long targetUserId, @Param("creatorId") Long creatorId);

	List<UserAppend> listAll(@Param("area") Integer area);

	List<UserAppend> listById(@Param("userAppendIdList") List<Long> userAppendIdList);
	
	List<UserAppend> listByName(@Param("name") String name);
	
	List<ListUserAppendVo> list(SearchUserAppendBo bo);
	
	Integer countList(SearchUserAppendBo bo);

	DetailUserAppendVo detail(@Param("userAppendId") Long userAppendId);

}
